3.2.8 \(\int \coth ^2(c+d x) (a+b \text {sech}^2(c+d x)) \, dx\) [108]

Optimal. Leaf size=18 \[ a x-\frac {(a+b) \coth (c+d x)}{d} \]

[Out]

a*x-(a+b)*coth(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4226, 1816, 213} \begin {gather*} a x-\frac {(a+b) \coth (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Coth[c + d*x]^2*(a + b*Sech[c + d*x]^2),x]

[Out]

a*x - ((a + b)*Coth[c + d*x])/d

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 1816

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 4226

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(d*ff*x)^m*((a + b*(1 + ff^2*x^2)^(n/2))^p/(1 + ff^2
*x^2)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] && IntegerQ[n/2] && (IntegerQ[m/2] ||
EqQ[n, 2])

Rubi steps

\begin {align*} \int \coth ^2(c+d x) \left (a+b \text {sech}^2(c+d x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {a+b \left (1-x^2\right )}{x^2 \left (1-x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {a+b}{x^2}-\frac {a}{-1+x^2}\right ) \, dx,x,\tanh (c+d x)\right )}{d}\\ &=-\frac {(a+b) \coth (c+d x)}{d}-\frac {a \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=a x-\frac {(a+b) \coth (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
time = 0.03, size = 41, normalized size = 2.28 \begin {gather*} -\frac {b \coth (c+d x)}{d}-\frac {a \coth (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};\tanh ^2(c+d x)\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Coth[c + d*x]^2*(a + b*Sech[c + d*x]^2),x]

[Out]

-((b*Coth[c + d*x])/d) - (a*Coth[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, Tanh[c + d*x]^2])/d

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(42\) vs. \(2(18)=36\).
time = 1.76, size = 43, normalized size = 2.39

method result size
risch \(a x -\frac {2 a}{d \left ({\mathrm e}^{2 d x +2 c}-1\right )}-\frac {2 b}{d \left ({\mathrm e}^{2 d x +2 c}-1\right )}\) \(43\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(coth(d*x+c)^2*(a+b*sech(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

a*x-2/d/(exp(2*d*x+2*c)-1)*a-2/d/(exp(2*d*x+2*c)-1)*b

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 47 vs. \(2 (18) = 36\).
time = 0.29, size = 47, normalized size = 2.61 \begin {gather*} a {\left (x + \frac {c}{d} + \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} - 1\right )}}\right )} + \frac {2 \, b}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} - 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)^2*(a+b*sech(d*x+c)^2),x, algorithm="maxima")

[Out]

a*(x + c/d + 2/(d*(e^(-2*d*x - 2*c) - 1))) + 2*b/(d*(e^(-2*d*x - 2*c) - 1))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (18) = 36\).
time = 0.37, size = 39, normalized size = 2.17 \begin {gather*} -\frac {{\left (a + b\right )} \cosh \left (d x + c\right ) - {\left (a d x + a + b\right )} \sinh \left (d x + c\right )}{d \sinh \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)^2*(a+b*sech(d*x+c)^2),x, algorithm="fricas")

[Out]

-((a + b)*cosh(d*x + c) - (a*d*x + a + b)*sinh(d*x + c))/(d*sinh(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \operatorname {sech}^{2}{\left (c + d x \right )}\right ) \coth ^{2}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)**2*(a+b*sech(d*x+c)**2),x)

[Out]

Integral((a + b*sech(c + d*x)**2)*coth(c + d*x)**2, x)

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 30, normalized size = 1.67 \begin {gather*} \frac {{\left (d x + c\right )} a - \frac {2 \, {\left (a + b\right )}}{e^{\left (2 \, d x + 2 \, c\right )} - 1}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(coth(d*x+c)^2*(a+b*sech(d*x+c)^2),x, algorithm="giac")

[Out]

((d*x + c)*a - 2*(a + b)/(e^(2*d*x + 2*c) - 1))/d

________________________________________________________________________________________

Mupad [B]
time = 0.11, size = 25, normalized size = 1.39 \begin {gather*} a\,x-\frac {2\,\left (a+b\right )}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(coth(c + d*x)^2*(a + b/cosh(c + d*x)^2),x)

[Out]

a*x - (2*(a + b))/(d*(exp(2*c + 2*d*x) - 1))

________________________________________________________________________________________